package com.bs.blogspace.service.impl;

import com.bs.blogspace.mapper.UserLogMapper;
import com.bs.blogspace.pojo.UserLog;
import com.bs.blogspace.service.UserLogServie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;

@Service
public class UserLogServiceImpl implements UserLogServie {
    @Autowired
    private UserLogMapper userLogMapper;
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Override
    public void insert(UserLog userLog) {
        userLog.setCreatetime(LocalDateTime.now());
        userLogMapper.insert(userLog);

    }
}
